package com.group02.community.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group02.community.entity.owner.ZyOwnerRoom;
import com.group02.community.entity.vo.OwnerVO;
import com.group02.community.mapper.OwnerRoomMapper;
import com.group02.community.service.OwnerRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OwnerRoomServiceImpl extends ServiceImpl<OwnerRoomMapper, ZyOwnerRoom> implements OwnerRoomService {

    @Autowired
    private OwnerRoomMapper ownerRoomMapper;
    @Override
    public List<String> getRoomStatus() {
        return ownerRoomMapper.getRoomStatus();
    }

    @Override
    public IPage<OwnerVO> getAllOwnerRoom(Long current, Long size, String status) {
        Page<OwnerVO> ownerVOPage = new Page<>(current, size);
        ownerVOPage.setOptimizeCountSql(false);
        return ownerRoomMapper.getAllOwnerRoom(ownerVOPage,status);
    }

}
